﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using WeatherServiceLibrary.Code;

namespace WeatherServiceLibrary
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {

        [OperationContract]
        List<Observation> GetLast24Observations();

        [OperationContract]
        List<StationObservation> GetStationObservations(int stationID, int count = 24);

        [OperationContract]
        Station GetWarmest(out double? temp);

        [OperationContract]
        List<Station> GetStations();

        [OperationContract]
        List<Station> GetStationsWhereLower(double temp);

        [OperationContract]
        List<Station> GetStationsWhereHigherOrEqual(double temp);

        [OperationContract]
        double GetPercipitationsSum(DateTime begin, DateTime end, String stationName);

    }



    // Use a data contract as illustrated in the sample below to add composite types to service operations
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }
}
